package aooO.crm.Service.impl;


import aooO.crm.Service.TranRemarkService;
import aooO.crm.mapper.TranRemarkMapper;
import aooO.crm.pojo.TranRemark;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TranRemarkServiceImpl implements TranRemarkService {
    @Autowired
    TranRemarkMapper tranRemarkMapper;

    @Override
    public List<TranRemark> queryTranRemarkForDetailByTranId(String id) {
        return tranRemarkMapper.selectTranRemarkForDetailByTranId(id);
    }

    @Override
    public int saveCreateTranRemark(TranRemark tranRemark) {
        List<TranRemark> list=new ArrayList<>();
        list.add(tranRemark);
        return tranRemarkMapper.insertTranRemarks(list);
    }

    @Override
    public int deleteTranRemarkById(String id) {
        String[] ids=new String[1];
        ids[0]=id;
        return tranRemarkMapper.deleteTranRemarkByTranIds(ids);
    }

    @Override
    public int saveEditTranRemark(TranRemark tranRemark) {
        return tranRemarkMapper.updateTranRemark(tranRemark);
    }
}
